<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>
    <? include_once("../controller/data_add.php"); ?>
    <?php include_once('module/mod-nkeditor.php'); ?>

</head>


<body>
<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>



<div id="container" class="<? echo $now_extender ?>">
    <div id="maincontent">


        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>



        <div id="content">

            <!--标题设定-->
            <?php $page_title='编辑';?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>







           <div class="detail-box">


               <ul class="detail-boxing">
                   <form id="data_form" method="post" class="layui-form"
                         action ="data_add_function.php?<? echo $data['url_parameter'] ?>"
                         enctype="multipart/form-data">

                       <input type="hidden"  name="nid" value="<? echo $data['data_detail']['nid']?>" >

                       <fieldset class="layui-elem-field layui-field-title" >
                           <legend>基本信息</legend>
                       </fieldset>

                       <blockquote class="layui-elem-quote">基本信息多数是对外使用的资料，请细心填写。</blockquote>
                       <br/>


                       <!--普通的input文本输入-->
                       <li class="layui-form-item name">
                           <label class="layui-form-label">名称：</label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input"  name="ai_name"  value="<? echo $data['data_detail']['name'] ?>">
                               <em class="explain">(<u style="color:red">*必填项目</u>, 填写标题) </em>
                           </div>
                       </li>



                       <!--普通的textarea多行文本输入-->
                       <li class="layui-form-item introduce">
                           <label class="layui-form-label">简介：</label>
                           <div class="layui-input-block">
                               <textarea class="layui-textarea" name="ai_introduce"  ><?echo  $data['data_detail']['introduce']?></textarea>
                               <em class="explain">(填写本文的概述)</em>
                           </div>
                       </li>

                       <!--单张图片的上传，需要优化-->
                       <? include("module/mod-image-upload.php");?>



                       <!--富文本编辑框-->
                        <li class="layui-form-item detail">
                            <label class="layui-form-label">资料详情：</label>
                                <div class="layui-input-block">
                                    <textarea name="ai_detail" style="width:1000px;height:400px;visibility:hidden;"><? echo $data['data_detail']['detail'] ?></textarea>
                                    <em class="explain">(填写详细页面文字、图片等主体内容)</em>
                                </div>
                        </li>





                       <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;" id="content3">
                           <legend>更多资料</legend>
                       </fieldset>

                       <br/>




<!--                       <li class="layui-form-item video">-->
<!--                           <label class="layui-form-label">视频上传1：</label>-->
<!--                           <div class="layui-input-block">-->
<!--                               <input type="file" id="upload_video"/>-->
<!--                               <button type="button" class="layui-btn" id="UploadAction">上传视频</button>-->
<!--                               <div class="layui-progress" style="margin:10px 0;" lay-filter="progress"-->
<!--                                    lay-showPercent="true" id="prouploadfile">-->
<!--                                   <div class="layui-progress-bar" lay-percent="0%"></div>-->
<!--                               </div>-->
<!---->
<!--                               <video id="video"-->
<!--                                      src="/uploadfiles/--><?// echo $theme_folder ?><!--/--><?php //echo $data['data_detail']['video_path']; ?><!--"-->
<!--                                      controls="controls" width="100" height="100"> 您的浏览器不支持 video 标签。-->
<!--                               </video>-->
<!---->
<!---->
<!--                           </div>-->
<!---->
<!--                           <input type="hidden" name="ai_video_path" class="video_path"-->
<!--                                  value="--><?php //echo $data['data_detail']['video_path']; ?><!--"/>-->
<!---->
<!--                           <input type="hidden" id="duration" name="ai_video_time"-->
<!--                                  value="--><?php //echo $data['data_detail']['video_time']; ?><!--"/>-->
<!--                           <input type="hidden" id="video_img" name="ai_video_img"-->
<!--                                  value="--><?php //echo $data['data_detail']['video_img']; ?><!--"/>-->
<!---->
<!--                           <em class="explain">视频上传中，请勿刷新或者提交</em>-->
<!--                       </li>-->




                       <!--单选项-->
                       <li class="layui-form-item publish">
                           <label class="layui-form-label">发布状态：</label>
                           <div class="layui-input-block">
                               <input name='ai_publish' type='radio' value='1' title="立即发布"
                                   <? if ($data['data_detail']['publish'] == '1') {echo "checked='checked'";} ?>/>
                               <input name='ai_publish' type='radio' value='0' title="暂未发布"
                                   <? if ($data['data_detail']['publish'] == '0') {echo "checked='checked'";} ?>/>
                               <em class="explain">(选择立即发布，以上信息才能在前台显示；选择暂未发布，只对以上信息进行保存，不在前台显示)</em>
                           </div>
                       </li>



                       <!--时间选择-->
                       <li class="layui-form-item inputtime">
                           <label class="layui-form-label">发布时间：</label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input"
                                      name="ai_date" size="20" id="publish_date"
                                      value="<? echo date("Y-m-d H:i:s"); ?>"
                                      onclick="laydate({istime: true,elem: '#publish_date', format: 'YYYY-MM-DD })"
                                       >
                               <em class="explain">(填写发布的时间)</em>
                          </div>
                       </li>





                       <div class="function">

                           <button class="layui-btn"  lay-submit type="submit" >立即提交</button>
                           <input type="reset" class="layui-btn" value="重置"/>

                           <a 	class="layui-btn layui-btn-normal" href="#content1" style="margin-left: 35px">基本信息</a>
                           <a 	class="layui-btn layui-btn-normal" href="#content2">SEO设置</a>
                           <a href="javascript:;" class="layui-btn layui-bg-red layui-icon layui-icon-top go_top"></a>
                       </div>



                   </form>
               </ul>
           </div>
        </div>



        <?
        //==============================================================================
        //这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
        //==============================================================================
        ?>



            </div>
            <!--detail-box end-->


        </div>
        <!--content端點01-->



</div>
<!--maincontent-->
<br class="clearfloat"/>
</div>
<!--container-->
</div>





<!--渲染日期需要用到的-->
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#publish_date' //指定元素
            ,type: 'datetime'
        });
    });
</script>




<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>

</body>
</html>